<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .demo {
            width: 200px;
            height: 50px;
            border: 1px solid #000;
            text-align: center;
            line-height: 50px;
        }
    </style>
</head>

<body>
    <div class="demo" onclick="getTime()"></div>
    <script src="./js/jquery-3.2.1.min.js"></script>
    <script>
        // console.log(add(100));
        // function add (a) {
        //     if(a > 1){
        //         return a + add(a-1);
        //     } else {    
        //         return 1;
        //     }
        // }
        function getTime() {
            $.ajax({
                type: 'GET',
                url: 'https://doublebird.herokuapp.com/getinfo',
                dataType: 'jsonp',
                success: function (data) {
                    $('.demo').html(data.time);
                    // console.log(data.time);
                }
            })
        }

    </script>
</body>

</html>